package website.lhc.adminsystem.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import website.lhc.admincommo.base.Resp;
import website.lhc.adminsystem.dto.LoginDto;
import website.lhc.adminsystem.service.IUserInfoService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @description:
 * @author: 582895699@qq.com
 * @time: 2021/2/8 下午 11:15
 */
@RestController
public class LoginController {

    @Autowired
    private IUserInfoService userInfoService;



    @PostMapping(value = "/login")
    public Resp login(@Validated @RequestBody LoginDto loginDto, HttpServletRequest request, HttpServletResponse response) {
        userInfoService.userLogin(loginDto, request, response);
        return Resp.ok();
    }
}
